import request from '@/utils/request'

const api = {
  getMaterialByReportUrl: '/material/get_material_by_report',
  getMaterialPageUrl: '/material/get_material_page',
  getPickingForMoldUrl: '/material/get_picking_for_mold',
  getMaterialHMoldUrl: '/material/get_material_h_mold',
  getMesPickingUrl: '/material/get_mes_picking',
  getMaterialHUrl: '/material/get_material_h',
  shangliaoScanBarcodeUrl: '/material/shangliao_scan_barcode',
  shangLiaoUrl: '/material/shang_liao',
  removeShangLiaoUrl: '/material/remove_shang_liao',
}

export async function removeShangLiaoApi(params: Map<string, any>) {
  const res = await request({
    url: api.removeShangLiaoUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function shangLiaoApi(params: Map<string, any>) {
  const res = await request({
    url: api.shangLiaoUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function shangliaoScanBarcodeApi(params: Map<string, any>) {
  const res = await request({
    url: api.shangliaoScanBarcodeUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function getMaterialHApi(params: Map<string, any>) {
  const res = await request({
    url: api.getMaterialHUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function getMesPickingApi(params: Map<string, any>) {
  const res = await request({
    url: api.getMesPickingUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function getPickingForMoldApi(params: Map<string, any>) {
  const res = await request({
    url: api.getPickingForMoldUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function getMaterialHMoldApi(params: Map<string, any>) {
  const res = await request({
    url: api.getMaterialHMoldUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function getMaterialPageApi(params: Map<string, any>) {
  const res = await request({
    url: api.getMaterialPageUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function getMaterialByReportApi(params: Map<string, any>) {
  const res = await request({
    url: api.getMaterialByReportUrl,
    method: 'get',
    params: params,
  })
  return res
}
